import http from "@/request/http";

export function login(data) {
    return http({
        url: "/login",
        method: "post",
        data,
    });
}

export function getStudentList(data) {
    return http({
        url: "/students",
        data,
    });
}

export function deleteOneFromStudent(data) {
    return http({
        url: `/students/${data}`,
        method: "delete",
    });
}

export function getInfoList() {
    return http({
        url: "/info",
        method: "get",
    });
}

// 添加和修改
export function changeInfoItem(data, method) {
    // data = JSON.parse(data);
    return http({
        url: "/info",
        method,
        data,
    });
}

export function deleteInfoItem(id) {
    return http({
        url: `/info/${id}`,
        method: "delete",
    });
}